package com.kcht.np.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.kcht.np.common.domain.BaseInsertUpdateDateEntity;
import lombok.*;
import lombok.experimental.Accessors;

/**
  * <p>
  * 后台系统用户
  * </p>
  *
  * @Package:        com.kcht.np.mp.entity
  * @Description:    后台系统用户
  * @Author:         liuqi
  * @CreateDate:     2020/3/31 11:45
 */

@EqualsAndHashCode(callSuper = true)
@Data
@Builder
@Accessors(chain = true)
@TableName(value = "tb_sys_user")
@NoArgsConstructor
@AllArgsConstructor
public class SysUser extends BaseInsertUpdateDateEntity implements java.io.Serializable {

    /**
     * 用户唯一id
     *
     * @date: 2019/12/11 22:15
     */
    @TableId(value = "uid", type = IdType.AUTO)
    private Long uid;

    /**
     * 用户名
     *
     * @date: 2019/12/11 22:15
     */
    private String username;

    /**
     * 邮箱
     *
     * @date: 2019/12/11 22:15
     */
    private String email;

    /**
     * 昵称
     *
     * @date: 2019/12/11 22:15
     */
    private String nickname;

    /**
     * 密码
     *
     * @date: 2019/12/11 22:15
     */
    private String password;

    /**
     * 性别
     *
     * @date: 2019/12/11 22:15
     */
    private Integer gender;

    /**
     * 部门 Id
     *
     * @date: 2019/12/11 22:15
     */
    private Long deptId;

    /**
     * 状态 [ 0.禁用 1.可用 2.在线 ]
     *
     * @date: 2019/12/11 22:15
     */
    private Integer status;

    public static boolean isAdmin(Long userId)
    {
        return userId != null && 1L == userId;
    }

}